{include file='header.html'}
<script language="javascript" src="/plugin/jquery/ajaxfileupload.js"></script>
<script language="javascript">
   function uploadgoodsimg()
    {
        //starting setting some animation when the ajax starts and completes
        $("#loading")
        .ajaxStart(function(){
            $(this).show();
        })
        .ajaxComplete(function(){
            $(this).hide();
        });

        $.ajaxFileUpload
        (
            {
                url:'/index.php?m=upload&a=upload&t='+Math.random(), 
                secureuri:false,
                fileElementId:'upimg',
                dataType: 'json',
                success: function (data, status)
                {
                    if(typeof(data.error) != 'undefined')
                    {
                        if(data.error != '')
                        {
                           alert(data.msg);
                        }else
                        {
                             $("#imgShow").html("<img src='/"+data.imgurl+"' width='50'>");
							 $("#imgurl").val(data.imgurl);
                        }
                    }
                },
                error: function (data, status, e)
                {
					alert(data.msg)
  
                }
            }
        )
        
        return false;

    }
</script>
<ul class="nav nav-tabs">
<li><a href="{$appadmin}?m=navbar">{$lang.navbar_admin}</a></li> 
<li class="active"><a href="{$appadmin}?m=navbar&a=add">{$lang.navbar_add}</a></li>
</ul>

<div class="rbox">
<form action="{$appadmin}?m=navbar&a=save" method="post">
<input type="hidden" name="id" value="{$nav.id}">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="table table-bordered">


 {if !$parent}		
  <tr>
    <td height="30" align="right">{$lang.target}：</td>
    <td><select name="target" id="target">
      <option value="_self">{$lang._self}</option>
      <option value="_blnk" {if $nav.target eq '_blank'} selected="selected"{/if}>{$lang._blank}</option>
    </select></td>
  </tr>
  {/if}
  {if $parent}	
  <tr>
    <td width="16%" height="30" align="right">{$lang.last_category}：</td>
    <td width="84%">
    <input type="hidden" name="pid" value="{$parent.id}">
      {$parent.title}</td>
  </tr>
  {/if}
  <tr>
    <td height="30" align="right">{$lang.name}：</td>
    <td><input name="title" type="text" value="{$nav.title}" />

  </tr>
  <tr>
    <td height="30" align="right">{$lang.link_url}：</td>
    <td><input name="link_url" type="text" id="link_url" value="{$nav.link_url}" size="40" /></td>
  </tr>
  {if !$parent}
  <tr>
    <td height="30" align="right">{$lang.position}：</td>
    <td><select name="group_id" id="group_id">
    	{foreach item=g key=k from=$group_list}
        <option value="{$k}" {if $k eq $nav.group_id} selected{/if}>{$g}</option>
        {/foreach}
    </select></td>
  </tr>
  {/if}
  
      <tr>
    <td align="right">图标：</td>
    <td>
    <div class="btn-upload">
      <input type="file" name="upimg" class="btn-upload-file" id="upimg" onChange="uploadgoodsimg()">
      </div>
      <label  id="loading" style="color:red; display:none;">正在上传中...</label>
      <input type="hidden" name="logo" id="imgurl" value="{$nav.logo}">
      <span id="imgShow">
      {if $nav.logo}
      <img src="/{$nav.logo}">
      {/if}
      </span>
      </td>
  </tr>
  
  <tr>
    <td height="30" align="right">m：      </td>
    <td><input name="m" type="text" id="m" value="{$nav.m}" /></td>
  </tr>
  <tr>
    <td height="30" align="right">a：</td>
    <td><input name="a" type="text" id="a" value="{$nav.a}" /></td>
  </tr>
  <tr>
    <td height="30" align="right">{$lang.sort}：</td>
    <td><input name="orderindex" type="text" id="orderindex" value="{$nav.orderindex}" /></td>
  </tr>
  <tr>
    <td height="30" align="right">&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="{$lang.submit}" class="btn" /></td>
  </tr>
</table>

</form>
</div>
{include file='footer.html'}